package structures;

import java.sql.Date;

/**
 * A project list entry.
 * Because a simple string in the project list doesn't give me access to the
 * unique identifier (project_id) of a project and because using a Project
 * class means either creating a custom table model or limiting Project's
 * toString to print only name (or id and name)
 * @author darin
 *
 */
public class Project {
	/**
	 * The project_id.
	 */
	private int projectId;
	/**
	 * the project_name.
	 */
	private String projectName;
	/**
	 * a description of the project
	 */
	private String projectDesc;
	/**
	 * The date the project was started (created)
	 */
	private Date projectDate;
	/**
	 * an empty constructor.
	 */
	public Project() { };
	/**
	 * Create a new ProjectListEntry with specified id and name.
	 * @param id the project_id
	 * @param name the project_name
	 * @param desc a description of the project
	 * @param date the date the project was created
	 *
	 */
	public Project(final int id,
			final String name,
			final String desc,
			final Date date) {
		projectId = id;
		projectName = name;
		projectDesc = desc;
		projectDate = date;
	}

	/**
	 * @return int the project Id
	 */
	public final int getProjectId() {
		return projectId;
	}

	/**
	 * @param id the project id to set
	 */
	public final void setProjectId(final int id) {
		projectId = id;
	}

	/**
	 * @return String the project_name
	 */
	public final String getProjectName() {
		return projectName;
	}

	/**
	 * @param name String the project_name to set
	 */
	public final void setProjectName(final String name) {
		projectName = name;
	}

	/**
	 * @return the projectDesc
	 */
	public final String getProjectDesc() {
		return projectDesc;
	}
	/**
	 * @param desc the projectDesc to set
	 */
	public final void setProjectDesc(final String desc) {
		projectDesc = desc;
	}
	/**
	 * @return the projectDate
	 */
	public final Date getProjectDate() {
		return projectDate;
	}
	/**
	 * @param date the projectDate to set
	 */
	public final void setProjectDate(final Date date) {
		projectDate = date;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return "[" + projectId + "] " + projectName;
	}
}
